/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cl.zeke.pizzastore.negocio.services.impl;

import cl.zeke.pizzastore.negocio.services.AsincronoService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.logging.Level;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 *
 * @author taller
 */

@Service
@Scope(proxyMode = ScopedProxyMode.INTERFACES)
public class AsincronoServiceImpl implements AsincronoService {

    private static Logger log = LoggerFactory.getLogger(AsincronoServiceImpl.class);
    
    @Async
    @Override
    public void calculo() {
    
        log.debug("inicie calculo costoso");
        try {
            Thread.sleep(10000);
        } catch (InterruptedException ex) {
            log.error("error", ex);
        }
        log.debug("termine calculo costoso");
    
    }
    
    
    
    
}
